<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>列表的排序过渡</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    
    <!-- <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script> -->
    <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.5.1/lodash.js"></script>
    <style>
        .v-move{
            transition: all 1s;
        }
        p{
            border: 1px solid red;
            width: 50px;
        }

    </style>
</head>

<body>
    <div id="app">
       <button @click="sort">反转</button>
       <transition-group tag="div">
            <p v-for="item in list" :key="item">{{item}}</p>
       </transition-group>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                list:[1,2,3,4,5,6],
            },
            methods: {
                sort(){
                    this.list=_.shuffle(this.list);
                }
                
            },

        })
    </script>
</body>

</html>